<template>
    <div>
        <el-form :inline="true" :model="asset" label-width="70px">
            <el-form-item label="患者姓名">
                <el-input placeholder="请输入查询的患者姓名" v-model="asset.pname"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="list()"><i class="el-icon-search">查询</i></el-button>
                <el-button type="info" @click="reset()"><i class=" el-icon-refresh">重置</i></el-button>
            </el-form-item>
        </el-form>

        <template>
            <el-table :data="assetPatientVoList" border stripe style="width: 100%">
                <el-table-column prop="aid" label="序号">
                </el-table-column>
                <el-table-column prop="pname" label="患者姓名">
                </el-table-column>
                <el-table-column prop="regis" label="挂号费用">
                </el-table-column>
                <el-table-column prop="project" label="检查项目">
                </el-table-column>
                <el-table-column prop="afees" label="检查费用">
                </el-table-column>
                <el-table-column prop="stay" label="住院费用">
                </el-table-column>
                <el-table-column prop="medic" label="用药费用">
                </el-table-column>
                <el-table-column prop="pid" label="患者编号">
                </el-table-column>

            </el-table>

            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                :current-page="pageInfo.pageNum" :page-sizes="[5, 10, 15, 20]" :page-size="pageInfo.pageSize"
                layout="total, sizes, prev, pager, next, jumper" :total="pageInfo.total">
            </el-pagination>
        </template>

    </div>
</template>
<script>

export default {
    data() {
        return {
            asset:{},
            assetPatientVoList: [],
            pageInfo: {
                pageNum: 1,
                pageSize: 5
            },
          
        }
    },

    mounted() {
        this.list();
    },

    methods: {
        reset(){
            this.asset = {},
            this.list();
        },


        list() {
            this.$axios.post("asset/assetSearch?pageNum=" + this.pageInfo.pageNum + "&pageSize=" + this.pageInfo.pageSize,this.asset)
                .then((result) => {
                    let vo = result.data;
                    if (vo.code == 200) {
                        this.assetPatientVoList = vo.data.list;
                        this.pageInfo = vo.data;
                    }
                }).catch((err) => [
                    console.log(err)
                ])
        },


        handleSizeChange(val) {
            this.pageInfo.pageSize = val;
            this.list()
        },
        handleCurrentChange(val) {
            this.pageInfo.pageNum = val;
            this.list()
        },


    },

  


}
</script>
<style></style>
